﻿using System;

namespace Fermat
{
    class Program
    {
        static void Main(string[] args)
        {
            const int N = 10000;
            long[] Cubic = new long[N];
            int Flag = 0;
            for (int i = 1; i < N; i++)//把立方数放入一个数组
            {
                Cubic[i] = (long)Math.Pow(i, 3);
            }
            for (int x = 0; x < N; x++)//对应z
            {
                for (int y = x; y < N; y++)//对应x
                {
                    for (int z = y + 1; z < N; z++)//对应y
                    {
                        if (Cubic[x] + Cubic[y] == Cubic[z])
                        {
                            Flag = 1;
                            Console.WriteLine("费马大定理不成立");
                            break;
                        }
                    }
                }
            }

            if (Flag == 0)
                Console.WriteLine("n=3,在10000以内，费马大定理成立");
        }
    }
}